package co.com.ces4.produccion.client.utils;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import com.smartgwt.client.types.TreeModelType;
import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.tree.*;

/**
 *
 * @author win
 */
public final class MenuBase extends TreeGrid {

    final private Tree menu;

    public MenuBase() {
        setWidth(240);
        setHeight("100%");
        setLayoutAlign(VerticalAlignment.CENTER);
        setLoadDataOnDemand(false);
        setCanFreezeFields(true);
        setCanReparentNodes(true);
        setAutoFetchData(false);
        setLoadDataOnDemand(false);
        setShowHeader(false);
        menu = new Tree();
        menu.setModelType(TreeModelType.PARENT);
        menu.setNameProperty("Description");
        menu.setIdField("idMenuItem");
        menu.setParentIdField("ReportsTo");
        menu.setData(DataConfiguration.getInstance().getMenu());
        menu.setTitleProperty("Menu");
        menu.setShowRoot(false);
        setStyleName("spacingMenu");
        setData(menu);
        draw();
    }
}
